/*
 * Copyright 2009 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.android.apps.mytracks.content;

import static com.google.android.apps.mytracks.content.ContentTypeIds.LONG_TYPE_ID;
import static com.google.android.apps.mytracks.content.ContentTypeIds.STRING_TYPE_ID;

import android.net.Uri;
import android.provider.BaseColumns;

/**
 * Constants for casos table.
 * 
 * @author Leif Hendrik Wilden
 */
public interface CasosColumns extends BaseColumns {

  public static final String TABLE_NAME = "casos";
  public static final String DEFAULT_SORT_ORDER = "_id";
  public static final Uri CONTENT_URI = Uri.parse(
      "content://com.doverty.android.maps.mytracks/casos");

  // Columns
  public static final String CLIENTEID = "clienteid";
  public static final String ASUNTO = "asunto";
  public static final String FECHAINICIO = "fechainicio"; // track id
  public static final String FECHAFIN = "fechafin";
  public static final String NOMBRE = "nombre";
  public static final String ORGANO = "organo";
  public static final String TIEMPOCONTRATADO = "tiempocontratado";
  
  public static final String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " (" 
      + _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
      + CLIENTEID + " INTEGER, "
      + ASUNTO + " STRING, "
      + FECHAINICIO + " STRING, "
      + FECHAFIN + " STRING, "
      + NOMBRE + " STRING, "
      + ORGANO + " STRING, "
      + TIEMPOCONTRATADO + " INTEGER, "
      + " FOREIGN KEY ("+CLIENTEID+") REFERENCES "+ClientesColumns.TABLE_NAME+" ("+ClientesColumns._ID+") ON DELETE CASCADE"
      + ");";
  
  public static final String[] COLUMNS = {
      _ID,
      CLIENTEID,
      ASUNTO,
      FECHAINICIO,
      FECHAFIN,
      NOMBRE,
      ORGANO,
      TIEMPOCONTRATADO
    };
    
  public static final byte[] COLUMN_TYPES = {
      LONG_TYPE_ID, // id
      LONG_TYPE_ID, // cliente id
      STRING_TYPE_ID, // asunto
      STRING_TYPE_ID, //fechainicio
      STRING_TYPE_ID, // fechafin
      STRING_TYPE_ID, // nombre
      STRING_TYPE_ID, // organo
      LONG_TYPE_ID // tiempocontratado
  }; 
}
